/**
 * @file   test_logic_analyzer003.c
 * @brief  Testing with Logic analyzer: Test mixture of 1 SYSTEM, 1 Periodic, and 1 BRR
 * Expected Results: 12000...12000...
 */
#include "../header/common.h"
#include "../header/os.h"
#include "../header/uart.h"
#include "../header/trace.h"

#ifdef test_logic_analyzer003

const unsigned char PPP[] = {1,3};
const unsigned int PT = sizeof(PPP)/2;
EVENT* print_event;
extern uint16_t trace_counter;

void generic_task(void)
{
	for (;;) {
		PORTD |= _BV(PORTD7);
		PORTD &= 0x00;
		Task_Next();
	}
}

void system_task(void)
{
	PORTD |= _BV(PORTD5);
	PORTD &= 0x00;

	Task_Next();
}

void periodic_task(void)
{
	for (;;) {
		PORTD |= _BV(PORTD6);
		PORTD &= 0x00;

		Task_Create(system_task,2,SYSTEM,2);
		Task_Next();
	}
}

int main(void) {
	DDRD = (1<<PORTD4) | (1<<PORTD5) | (1<<PORTD6) | (1<<PORTD7);

    Task_Create(periodic_task,1,PERIODIC,1);
    Task_Create(generic_task,0, BRR, 1);

    return 0;
}

#endif
